package com.lagou.rabbitmq.entity;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableLogic;
import com.baomidou.mybatisplus.annotation.TableName;
import com.fasterxml.jackson.databind.annotation.JsonSerialize;
import com.fasterxml.jackson.databind.ser.std.ToStringSerializer;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;

import java.sql.Timestamp;
import lombok.NoArgsConstructor;
import lombok.experimental.SuperBuilder;

@TableName("t_order")
@Data
@SuperBuilder
@NoArgsConstructor
@AllArgsConstructor
public class OrderEntity {

    @JsonSerialize(using = ToStringSerializer.class)
    @TableId(type = IdType.ASSIGN_ID)
    private Long id;

    private String orderNumber;

    private OrderStatus status;

    /** 逻辑删除（0未删除，1已删除） */
    @Builder.Default
    @TableLogic
    protected Integer delFlag = 0;

    public enum OrderStatus{
        UNPAID,
        CANCLED,
        PAID;
    }
}
